var app = getApp();
Page({
  data: {
   goodshow:[],
   apiurl: app.data.apiurl,
  },
  onLoad: function (options) {
    var that=this
    wx.setNavigationBarTitle({
      title: '搜索'
    })
    wx.request({
      url: getApp().data.apiurl + '/index.php/index/index/seargoods',
      data: {
      },
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
        console.log(res);
        that.setData({
          seargoods: res.data,
          goodshow: res.data.data[0]['goodshow'].split("|"),
        });
      }
    });
  },
  formSubmit: function (e) {
    var that = this
    console.log('form发生change事件，携带value值为：', e.detail.value);
    wx.request({
      url: getApp().data.apiurl + '/index.php/index/index/seargoods',
      data: {
          gtitle:e.detail.value.gtitle
      },
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
        console.log(res);
        that.setData({
          seargoods: res.data,
          goodshow: res.data.data[0]['goodshow'].split("|"),
        });
      }
    });
  },
  a: function () {
    console.log()
  },
})